<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>

</head>

<body>
    <div id="sc">
        请输入张三的成绩：<input type="text" v-model="score">
        <h2>{{fn(score)}}</h2>
    </div>
</body>
<script>
    var sc = new Vue({
        el:"#sc",
        data:{
            score:"",
            
        },
        methods: {
            fn(e){
                if (e>=90&&e<=100) {
                    return "优秀"
                }else if (e>=75&&e<90) {
                    return "良好"
                }else if (e>=60&&e<75) {
                    return "及格"
                }else if(e>=0&&e<=60&&e!=""){
                    return "不及格"
                }else return ""
            }
        },
        
    })
</script>

</html>